/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const distributionRouter = {
  path: '/distribution',
  component: Layout,
  hidden:false,
  redirect: 'noRedirect',
  name: '分销',
  meta: {
    title: '分销',
    icon: 'shopping'
  },
  children: [
    {
      path: 'workbrench',
      component: () => import('@/views/distribution/workbrench/workbrench'),
      name: '总览',
      meta: { title: '总览' }
    },
    {
      path: 'setting',
      component: () => import('@/views/distribution/index'),
      name: '设置',
      meta: { 
        title: '设置',
        roles: [ 'sale']
      },
      children:[
        {
          path: 'product',
          component: () => import('@/views/distribution/product/product'),
          name: '产品',
          meta: { title: '产品' }
        },
        {
          path: 'product-add',
          component: () => import('@/views/distribution/product/product-add'),
          name: '增加产品',
          hidden: true,
          meta: { title: '增加产品' }
        }

      ]
    },
    {
      path: 'grade',
      component: () => import('@/views/distribution/grade/grade'),
      name: '等级',
      meta: { title: '等级' }
    },
    {
      path: 'grade-add',
      component: () => import('@/views/distribution/grade/grade-add'),
      name: '新等级',
      hidden: true,
      meta: { title: '新等级' }
    },
    {
      path: 'order',
      component: () => import('@/views/distribution/order/order'),
      name: '订单',
      meta: { title: '订单' }
    },
    {
      path: 'order-detail',
      hidden: true,
      component: () => import('@/views/distribution/order/order-detail'),
      name: '订单信息',
      meta: { title: '订单信息' }
    },
    {
      path: 'withdraw',
      component: () => import('@/views/distribution/withdraw/withdraw'),
      name: '提现',
      meta: { title: '提现' }
    },
    {
      path: 'agent',
      component: () => import('@/views/distribution/agent/agent'),
      name: '代理',
      meta: { title: '代理' }
    },
    {
      path: 'agent-detail',
      hidden: true,
      component: () => import('@/views/distribution/agent/agent-detail'),
      name: '代理档案',
      meta: { title: '代理档案' }
    },
    {
      path: 'commission',
      component: () => import('@/views/distribution/commission/commission'),
      name: '佣金',
      meta: { title: '佣金' }
    },
  ]
}

export default distributionRouter
